package fp.thetrainline.screens;

import org.openqa.selenium.NoSuchElementException;

import fp.thetrainline.utils.DriverSupport;
import fp.thetrainline.utils.ElementName;
import fp.thetrainline.utils.ElementType;

public class OutwardTrainsExtend {

	public static void earlierTrains( DriverSupport driver ) {
		driver.click( ElementType.ID, ElementName.EARLIER_BUTTON );
		
	}
	
	public static void pressPoundButton( DriverSupport driver ) {
		while( true ) {
			try {
				driver.click( ElementType.XPATH, ElementName.POUND_BUTTON );
				break;
			} catch( NoSuchElementException e ) {
				earlierTrains( driver );
			}
		}
	}
	
}
